define(function(require, exports, module) {
	"use strict";

	var baseService = require('Base_Service');
	// 控制器名
	exports.controller = "Orders";
	
	/* 报名 */
	exports.orderList = function(success) {
		var data = {
			"OrderType":'Apply',
			"PageIndex":0,
			"PageSize":100
		};
		return baseService.post(
			baseService.getApiUrl(exports.controller, "List"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};
	
	exports.pay = function(code , success){
		var data = {
			'Code' : code
		};
		return baseService.post(
			baseService.getApiUrl(exports.controller, "Pay"),
			data,
			function(retval) {
				success && success(retval);
			}
		)
	}
	
	exports.wxpay = function(code,success){
		var data = {
			'code' : code
		};
		return baseService.post(
			baseService.getApiUrl(exports.controller, "WXPrePay"),
			data,
			function(retval) {
				success && success(retval);
			}
		)
	}
	
	exports.alipay = function(code,success){
		var data = {
			'code' : code
		};
		return baseService.post(
			baseService.getApiUrl(exports.controller, "AliPrePay"),
			data,
			function(retval) {
				success && success(retval);
			}
		)
	}
	
	/*
	 * 取消订单
	 * */
	exports.cancel = function(code , success){
		var data = {
			'Code' : code
		};
		return baseService.post(
			baseService.getApiUrl(exports.controller, "Cancel"),
			data,
			function(retval) {
				success && success(retval);
			}
		)
	}
	
});